#include "view_prompt.h"
#include "view_common.h"
#include "display_ctrl.h"
#include "platform_assert.h"
#include "lfs_file_manager_auto.h"
#include "rtc.h"
#include "datetime.h"
#include "blecom.h"
#include "battery_ctrl.h"
#include "sport_his.h"
#include "display_ctrl.h"
#include "display_interface_240x240.h"
#include "datetime.h"
#include "heart_rate_interface.h"
#include "font/num_font.h"
#include "font_mngr.h"
#include "app_trace.h"
#include "view_prompt_message.h"
#include "view.h"
#include "motor.h"
#include "app_timer.h"
#include "view_prompt.inc"
#include "times/view_time_0.h"
#include "m_product_test.h"
#include "weather_ctrl.h"
#include "math.h"
#if defined(USE_CT1711)
#include "body_temperature.h"
#endif
#define LOG(fmt, ...) app_trace_log(fmt "\r\n", ##__VA_ARGS__)
#define ANIMATION_TICKS_MAX (APP_TIMER_CLOCK_FREQ)
// ANCS中转的变量
void view_prompt_not_connect_display(void)
{
    if (disp_ctrl.loop_cnt == 0)
    {
        disp_ctrl.auto_refresh_time = 1000;
        disp_ctrl.auto_close_delay = disp_ctrl.auto_refresh_time + 1000;
        if (disp_ctrl.auto_refresh_count >= 3)
        {
            display_show_type_recover();
            return;
        }
        datetime_t UIdatetime = DateSync();
        disp_ctrl.com_data.i_temp[3] = UIdatetime.time.hour;
        if (if_time_hour_system_12())
        {
            disp_ctrl.com_data.i_temp[3] %= 12;
            if (disp_ctrl.com_data.i_temp[3] == 0)
            {
                disp_ctrl.com_data.i_temp[3] = 12;
            }
        }
        disp_ctrl.com_data.i_temp[4] = UIdatetime.time.minute;
        disp_ctrl.com_data.i_temp[8] = battery_ctrl_if_charging();
        disp_ctrl.com_data.i_temp[9] = battery_ctrl_get_percent();
        disp_ctrl.com_data.i_temp[5] = ble_if_connected();
    }
    if (disp_ctrl.com_data.i_temp[5])
    {
        disp_draw_user_image(42, 3, img_ble_connect);
    }
    else
    {
        disp_draw_user_image(42, 0, img_ble_disconnect);
    }
    show_common_time(disp_ctrl.com_data.i_temp[3], disp_ctrl.com_data.i_temp[4]);
    show_time_0_battery(disp_ctrl.com_data.i_temp[9], disp_ctrl.com_data.i_temp[8]);
#if defined(Z2_BOARD) || defined(BT100_BOARD)
    _disp_show_flash_img(DISP_LFS_FILE_INDEX_0, 57, 31, FILE_IMG_1306_nocon_57_31);
#else
    _disp_show_flash_img(DISP_LFS_FILE_INDEX_0, 73, 41, FILE_IMG_J103_notconnected_73_41);
#endif
    // _disp_show_flash_img(DISP_LFS_FILE_INDEX_1, 49, 183, FILE_IMG_J104_notconnected_text_49_183);
    // disp_show_localize(DISP_LFS_FILE_INDEX_1, localize_string_key_AlertNotConnected, FILE_IMG_localize_en_AlertNotConnected_49_183, 49, 183, 50);
    disp_show_localize(DISP_LFS_FILE_INDEX_1, localize_string_key_AlertNotConnected, 50);
}
void view_prompt_bind_success_display(void)
{
    if (disp_ctrl.loop_cnt == 0)
    {
        disp_ctrl.auto_refresh_time = 1000;
        disp_ctrl.auto_close_delay = disp_ctrl.auto_refresh_time + 1000;
        if (disp_ctrl.auto_refresh_count >= 3)
        {
            display_show_type_recover();
            return;
        }
        datetime_t UIdatetime = DateSync();
        disp_ctrl.com_data.i_temp[3] = UIdatetime.time.hour;
        if (if_time_hour_system_12())
        {
            disp_ctrl.com_data.i_temp[3] %= 12;
            if (disp_ctrl.com_data.i_temp[3] == 0)
            {
                disp_ctrl.com_data.i_temp[3] = 12;
            }
        }
        disp_ctrl.com_data.i_temp[4] = UIdatetime.time.minute;
        disp_ctrl.com_data.i_temp[8] = battery_ctrl_if_charging();
        disp_ctrl.com_data.i_temp[9] = battery_ctrl_get_percent();
        disp_ctrl.com_data.i_temp[5] = ble_if_connected();
    }
    if (disp_ctrl.com_data.i_temp[5])
    {
        disp_draw_user_image(42, 3, img_ble_connect);
    }
    else
    {
        disp_draw_user_image(42, 0, img_ble_disconnect);
    }
    show_common_time(disp_ctrl.com_data.i_temp[3], disp_ctrl.com_data.i_temp[4]);
    show_time_0_battery(disp_ctrl.com_data.i_temp[9], disp_ctrl.com_data.i_temp[8]);
#if defined(Z2_BOARD) || defined(BT100_BOARD)
    _disp_show_flash_img(DISP_LFS_FILE_INDEX_0, 57, 31, FILE_IMG_1307_con_57_31);
#else
    _disp_show_flash_img(DISP_LFS_FILE_INDEX_0, 73, 41, FILE_IMG_J101_connected_73_41);
#endif

    // _disp_show_flash_img(DISP_LFS_FILE_INDEX_1, 68, 183, FILE_IMG_J102_connected_text_68_183);
    // disp_show_localize(DISP_LFS_FILE_INDEX_1, localize_string_key_AlertConnected, FILE_IMG_localize_en_AlertConnected_68_183, 68, 183, 50);
    disp_show_localize(DISP_LFS_FILE_INDEX_1, localize_string_key_AlertConnected, 50);
}
void view_prompt_camera_ready_display(void)
{
    if (disp_ctrl.loop_cnt == 0)
    {
        disp_ctrl.auto_refresh_time = 100;
        disp_ctrl.auto_close_delay = 1000;
        if (disp_ctrl.auto_refresh_count > 8)
        {
            display_show(view_prompt_camera_fail, DISP_MODE_NORMAL);
            return;
        }
        datetime_t UIdatetime = DateSync();
        disp_ctrl.com_data.i_temp[3] = UIdatetime.time.hour;
        if (if_time_hour_system_12())
        {
            disp_ctrl.com_data.i_temp[3] %= 12;
            if (disp_ctrl.com_data.i_temp[3] == 0)
            {
                disp_ctrl.com_data.i_temp[3] = 12;
            }
        }
        disp_ctrl.com_data.i_temp[4] = UIdatetime.time.minute;
        disp_ctrl.com_data.i_temp[8] = battery_ctrl_if_charging();
        disp_ctrl.com_data.i_temp[9] = battery_ctrl_get_percent();
        disp_ctrl.com_data.i_temp[5] = ble_if_connected();
    }
    if (disp_ctrl.com_data.i_temp[5])
    {
        disp_draw_user_image(42, 3, img_ble_connect);
    }
    else
    {
        disp_draw_user_image(42, 0, img_ble_disconnect);
    }
    show_common_time(disp_ctrl.com_data.i_temp[3], disp_ctrl.com_data.i_temp[4]);
    show_time_0_battery(disp_ctrl.com_data.i_temp[9], disp_ctrl.com_data.i_temp[8]);
    int x = 32;
    int y = 73;
    _disp_show_flash_img(DISP_LFS_FILE_INDEX_0, x, y, FILE_IMG_9406_prompt_02);
    int index = FILE_IMG_9406_prompt_03 + disp_ctrl.auto_refresh_count % 9;
    x = 94;
    y = 110;
    _disp_show_flash_img(DISP_LFS_FILE_INDEX_1, x, y, index);
}
void view_prompt_camera_fail_display(void)
{
    if (disp_ctrl.loop_cnt == 0)
    {
        disp_ctrl.auto_refresh_time = 1000;
        disp_ctrl.auto_close_delay = disp_ctrl.auto_refresh_time + 1000;
        if (disp_ctrl.auto_refresh_count >= 3)
        {
            display_show_type_recover();
            return;
        }
        datetime_t UIdatetime = DateSync();
        disp_ctrl.com_data.i_temp[3] = UIdatetime.time.hour;
        if (if_time_hour_system_12())
        {
            disp_ctrl.com_data.i_temp[3] %= 12;
            if (disp_ctrl.com_data.i_temp[3] == 0)
            {
                disp_ctrl.com_data.i_temp[3] = 12;
            }
        }
        disp_ctrl.com_data.i_temp[4] = UIdatetime.time.minute;
        disp_ctrl.com_data.i_temp[8] = battery_ctrl_if_charging();
        disp_ctrl.com_data.i_temp[9] = battery_ctrl_get_percent();
        disp_ctrl.com_data.i_temp[5] = ble_if_connected();
    }
    // _disp_show_flash_img(DISP_LFS_FILE_INDEX_0, 0, 0, FILE_IMG_9407_prompt_01);
    _disp_show_flash_img(DISP_LFS_FILE_INDEX_0, 94, 22, FILE_IMG_9408_prompt_37_129);
    // disp_show_localize(DISP_LFS_FILE_INDEX_1, localize_string_key_OpenAppAlert, FILE_IMG_localize_en_OpenAppAlert_01_07, 37, 129, 50);
    disp_show_localize(DISP_LFS_FILE_INDEX_1, localize_string_key_OpenAppAlert, 50);

    if (disp_ctrl.com_data.i_temp[5])
    {
        disp_draw_user_image(42, 3, img_ble_connect);
    }
    else
    {
        disp_draw_user_image(42, 0, img_ble_disconnect);
    }
    show_common_time(disp_ctrl.com_data.i_temp[3], disp_ctrl.com_data.i_temp[4]);
    show_time_0_battery(disp_ctrl.com_data.i_temp[9], disp_ctrl.com_data.i_temp[8]);
}
bool view_prompt_distance_complete_event(int32_t view, event_param_t param)
{
    switch (param.event)
    {
    case event_view_entry:
        return true;
    }
    return false;
}

bool view_prompt_calories_complete_event(int32_t view, event_param_t param)
{
    switch (param.event)
    {
    case event_view_entry:
        return true;
    }
    return false;
}
bool view_prompt_find_wrist_event(int32_t view, event_param_t param)
{
    switch (param.event)
    {
    case event_view_exit:
    {
        motor_stop();
        return true;
    }
    }
    return false;
}

bool view_prompt_steps_complete_event(int32_t view, event_param_t param)
{
    switch (param.event)
    {
    case event_view_entry:
        return true;
    }
    return false;
}
#if defined(USE_CT1711)
bool view_prompt_hyperthemia_event(int32_t view, event_param_t param)
{
    switch (param.event)
    {
    case BUTTON_EVENT_SHORT_PRESS:
        display_show_type_recover();
        return true;
    }
    return false;
}
#endif
void view_prompt_distance_complete_display(void)
{
    if (disp_ctrl.loop_cnt == 0)
    {
        disp_ctrl.auto_refresh_time = 300;
        disp_ctrl.auto_close_delay = disp_ctrl.auto_refresh_time + 1000;
        if (disp_ctrl.auto_refresh_count >= 17)
        {
            display_show_type_recover();
            return;
        }
        if (system_config_get_km_mi() != 0)
        {
            disp_ctrl.com_data.i_temp[0] = sport_get_distance() * 0.6213712;
            disp_ctrl.com_data.i_temp[1] = 0;
        }
        else
        {
            disp_ctrl.com_data.i_temp[0] = sport_get_distance();
            disp_ctrl.com_data.i_temp[1] = 1;
        }
        datetime_t UIdatetime = DateSync();
        disp_ctrl.com_data.i_temp[3] = UIdatetime.time.hour;
        if (if_time_hour_system_12())
        {
            disp_ctrl.com_data.i_temp[3] %= 12;
            if (disp_ctrl.com_data.i_temp[3] == 0)
            {
                disp_ctrl.com_data.i_temp[3] = 12;
            }
        }
        disp_ctrl.com_data.i_temp[4] = UIdatetime.time.minute;
        disp_ctrl.com_data.i_temp[8] = battery_ctrl_if_charging();
        disp_ctrl.com_data.i_temp[9] = battery_ctrl_get_percent();
        disp_ctrl.com_data.i_temp[5] = ble_if_connected();
    }
    if (disp_ctrl.com_data.i_temp[5])
    {
        disp_draw_user_image(42, 3, img_ble_connect);
    }
    else
    {
        disp_draw_user_image(42, 0, img_ble_disconnect);
    }
    show_common_time(disp_ctrl.com_data.i_temp[3], disp_ctrl.com_data.i_temp[4]);
    show_time_0_battery(disp_ctrl.com_data.i_temp[9], disp_ctrl.com_data.i_temp[8]);
    img_gif_com_t const img_cfg_2 = {
        .gif_count = 4,
        .img[0].x = 32,
        .img[0].y = 23,
        .img[0].sn = FILE_IMG_J306_distance_13_160,
        .img[1].x = 32,
        .img[1].y = 23,
        .img[1].sn = FILE_IMG_J307_distance_13_160,
        .img[2].x = 32,
        .img[2].y = 23,
        .img[2].sn = FILE_IMG_J308_distance_13_160,
        .img[3].x = 32,
        .img[3].y = 23,
        .img[3].sn = FILE_IMG_J309_distance_13_160,
    };

    _disp_show_flash_img_gif_all(&img_cfg_2, DISP_LFS_FILE_INDEX_1);
    _disp_show_flash_img(DISP_LFS_FILE_INDEX_0, 13, 160, FILE_IMG_J305_caroies_num_13_160);
    int x = disp_draw_user_image_num_mid_filter_color(110, 171, disp_ctrl.com_data.i_temp[0] / 1000, 10 + 3, img_j301_TAB);
    if (disp_ctrl.com_data.i_temp[1])
    {
        disp_draw_user_image_filter_color(x, 171 + 7, img_common_km);
    }
    else
    {
        disp_draw_user_image_filter_color(x, 171 + 7, img_common_mi);
    }
}
void view_prompt_calories_complete_display(void)
{
    if (disp_ctrl.loop_cnt == 0)
    {
        disp_ctrl.auto_refresh_time = 300;
        disp_ctrl.auto_close_delay = disp_ctrl.auto_refresh_time + 1000;
        if (disp_ctrl.auto_refresh_count >= 17)
        {
            display_show_type_recover();
            return;
        }
        disp_ctrl.com_data.i_temp[0] = sport_get_calorie();
        datetime_t UIdatetime = DateSync();
        disp_ctrl.com_data.i_temp[3] = UIdatetime.time.hour;
        if (if_time_hour_system_12())
        {
            disp_ctrl.com_data.i_temp[3] %= 12;
            if (disp_ctrl.com_data.i_temp[3] == 0)
            {
                disp_ctrl.com_data.i_temp[3] = 12;
            }
        }
        disp_ctrl.com_data.i_temp[4] = UIdatetime.time.minute;
        disp_ctrl.com_data.i_temp[8] = battery_ctrl_if_charging();
        disp_ctrl.com_data.i_temp[9] = battery_ctrl_get_percent();
        disp_ctrl.com_data.i_temp[5] = ble_if_connected();
    }
    if (disp_ctrl.com_data.i_temp[5])
    {
        disp_draw_user_image(42, 3, img_ble_connect);
    }
    else
    {
        disp_draw_user_image(42, 0, img_ble_disconnect);
    }
    show_common_time(disp_ctrl.com_data.i_temp[3], disp_ctrl.com_data.i_temp[4]);
    show_time_0_battery(disp_ctrl.com_data.i_temp[9], disp_ctrl.com_data.i_temp[8]);
    img_gif_com_t const img_cfg_2 = {
        .gif_count = 4,
        .img[0].x = 32,
        .img[0].y = 23,
        .img[0].sn = FILE_IMG_J301_caroies_1_32_23,
        .img[1].x = 32,
        .img[1].y = 23,
        .img[1].sn = FILE_IMG_J302_caroies_2_32_23,
        .img[2].x = 32,
        .img[2].y = 23,
        .img[2].sn = FILE_IMG_J303_caroies_3_32_23,
        .img[3].x = 32,
        .img[3].y = 23,
        .img[3].sn = FILE_IMG_J304_caroies_4_32_23,
    };

    _disp_show_flash_img_gif_all(&img_cfg_2, DISP_LFS_FILE_INDEX_1);
    _disp_show_flash_img(DISP_LFS_FILE_INDEX_0, 13, 160, FILE_IMG_J305_caroies_num_13_160);
    int x = disp_draw_user_image_num_mid_filter_color(104, 171, disp_ctrl.com_data.i_temp[0], 10 + 3, img_j301_TAB);
    disp_draw_user_image_filter_color(x, 171 + 7, img_common_kcal);
}

void view_prompt_steps_complete_display(void)
{
    if (disp_ctrl.loop_cnt == 0)
    {
        disp_ctrl.auto_refresh_time = 300;
        disp_ctrl.auto_close_delay = disp_ctrl.auto_refresh_time + 1000;
        if (disp_ctrl.auto_refresh_count >= 17)
        {
            display_show_type_recover();
            return;
        }
        disp_ctrl.com_data.i_temp[0] = sport_get_present_step();
        datetime_t UIdatetime = DateSync();
        disp_ctrl.com_data.i_temp[3] = UIdatetime.time.hour;
        if (if_time_hour_system_12())
        {
            disp_ctrl.com_data.i_temp[3] %= 12;
            if (disp_ctrl.com_data.i_temp[3] == 0)
            {
                disp_ctrl.com_data.i_temp[3] = 12;
            }
        }
        disp_ctrl.com_data.i_temp[4] = UIdatetime.time.minute;
        disp_ctrl.com_data.i_temp[8] = battery_ctrl_if_charging();
        disp_ctrl.com_data.i_temp[9] = battery_ctrl_get_percent();
        disp_ctrl.com_data.i_temp[5] = ble_if_connected();
    }
    if (disp_ctrl.com_data.i_temp[5])
    {
        disp_draw_user_image(42, 3, img_ble_connect);
    }
    else
    {
        disp_draw_user_image(42, 0, img_ble_disconnect);
    }
    show_common_time(disp_ctrl.com_data.i_temp[3], disp_ctrl.com_data.i_temp[4]);
    show_time_0_battery(disp_ctrl.com_data.i_temp[9], disp_ctrl.com_data.i_temp[8]);
#if defined(UMG01_PROJECT)
    _disp_show_flash_img(DISP_LFS_FILE_INDEX_0, 51, 33, FILE_IMG_iocn_51_33);
#else
    img_gif_com_t const img_cfg_2 = {
        .gif_count = 4,
        .img[0].x = 32,
        .img[0].y = 23,
        .img[0].sn = FILE_IMG_J310_step_13_160,
        .img[1].x = 32,
        .img[1].y = 23,
        .img[1].sn = FILE_IMG_J311_step_13_160,
        .img[2].x = 32,
        .img[2].y = 23,
        .img[2].sn = FILE_IMG_J312_step_13_160,
        .img[3].x = 32,
        .img[3].y = 23,
        .img[3].sn = FILE_IMG_J313_step_13_160,
    };
    _disp_show_flash_img_gif_all(&img_cfg_2, DISP_LFS_FILE_INDEX_1);
    _disp_show_flash_img(DISP_LFS_FILE_INDEX_0, 13, 160, FILE_IMG_J305_caroies_num_13_160);
#endif
#if defined(UMG01_PROJECT)
    int x = disp_draw_user_image_num_mid_filter_color(104, 196, disp_ctrl.com_data.i_temp[0], 10 + 3, img_j301_TAB);
    disp_draw_user_image_filter_color(x, 196 + 3, img_common_step);
#else
    int x = disp_draw_user_image_num_mid_filter_color(104, 171, disp_ctrl.com_data.i_temp[0], 10 + 3, img_j301_TAB);
    disp_draw_user_image_filter_color(x, 171 + 3, img_common_step);
#endif
}
void view_prompt_lost_display(void)
{
    if (disp_ctrl.loop_cnt == 0)
    {
        datetime_t UIdatetime = DateSync();
        disp_ctrl.com_data.i_temp[3] = UIdatetime.time.hour;
        if (if_time_hour_system_12())
        {
            disp_ctrl.com_data.i_temp[3] %= 12;
            if (disp_ctrl.com_data.i_temp[3] == 0)
            {
                disp_ctrl.com_data.i_temp[3] = 12;
            }
        }
        disp_ctrl.com_data.i_temp[4] = UIdatetime.time.minute;
        disp_ctrl.com_data.i_temp[8] = battery_ctrl_if_charging();
        disp_ctrl.com_data.i_temp[9] = battery_ctrl_get_percent();
        disp_ctrl.com_data.i_temp[5] = ble_if_connected();
        disp_ctrl.auto_refresh_time = 500;
    }
    if (disp_ctrl.com_data.i_temp[5])
    {
        disp_draw_user_image(42, 3, img_ble_connect);
    }
    else
    {
        disp_draw_user_image(42, 0, img_ble_disconnect);
    }
    show_common_time(disp_ctrl.com_data.i_temp[3], disp_ctrl.com_data.i_temp[4]);
    show_time_0_battery(disp_ctrl.com_data.i_temp[9], disp_ctrl.com_data.i_temp[8]);
#if defined(Z2_BOARD) || defined(BT100_BOARD)
    _disp_show_flash_img(DISP_LFS_FILE_INDEX_0, 57, 31, FILE_IMG_1308_discon_57_31);
#else
    _disp_show_flash_img(DISP_LFS_FILE_INDEX_0, 60, 45, FILE_IMG_J105_disconnect_60_45);
#endif

    // _disp_show_flash_img(DISP_LFS_FILE_INDEX_1, 65, 172, FILE_IMG_J106_disconnect_text_65_172);
    // disp_show_localize(DISP_LFS_FILE_INDEX_1, localize_string_key_AlertDisconnect, FILE_IMG_localize_en_AlertDisconnect_65_172, 65, 172, 50);
    disp_show_localize(DISP_LFS_FILE_INDEX_1, localize_string_key_AlertDisconnect, 50);
}
void view_prompt_drink_display(void)
{
    if (disp_ctrl.loop_cnt == 0)
    {
        disp_ctrl.auto_refresh_time = 1000;
        disp_ctrl.auto_close_delay = disp_ctrl.auto_refresh_time + 1000;
        if (disp_ctrl.auto_refresh_count >= 5)
        {
            display_show_type_recover();
        }
        datetime_t UIdatetime = DateSync();
        disp_ctrl.com_data.i_temp[3] = UIdatetime.time.hour;
        if (if_time_hour_system_12())
        {
            disp_ctrl.com_data.i_temp[3] %= 12;
            if (disp_ctrl.com_data.i_temp[3] == 0)
            {
                disp_ctrl.com_data.i_temp[3] = 12;
            }
        }
        disp_ctrl.com_data.i_temp[4] = UIdatetime.time.minute;
        disp_ctrl.com_data.i_temp[8] = battery_ctrl_if_charging();
        disp_ctrl.com_data.i_temp[9] = battery_ctrl_get_percent();
        disp_ctrl.com_data.i_temp[5] = ble_if_connected();
    }
    if (disp_ctrl.com_data.i_temp[5])
    {
        disp_draw_user_image(42, 3, img_ble_connect);
    }
    else
    {
        disp_draw_user_image(42, 0, img_ble_disconnect);
    }
    show_common_time(disp_ctrl.com_data.i_temp[3], disp_ctrl.com_data.i_temp[4]);
    show_time_0_battery(disp_ctrl.com_data.i_temp[9], disp_ctrl.com_data.i_temp[8]);
#if defined(Z2_BOARD) || defined(BT100_BOARD)
    _disp_show_flash_img(DISP_LFS_FILE_INDEX_0, 57, 31, FILE_IMG_1303_water_57_31);
#else
    _disp_show_flash_img(DISP_LFS_FILE_INDEX_0, 64, 55, FILE_IMG_J109_drinkwater_64_55);
#endif

    // _disp_show_flash_img(DISP_LFS_FILE_INDEX_1, 61, 177, FILE_IMG_J110_drinkwater_61_177);
    // disp_show_localize(DISP_LFS_FILE_INDEX_1, localize_string_key_AlertDrink, FILE_IMG_localize_en_AlertDrink_61_177, 61, 177, 50);
    disp_show_localize(DISP_LFS_FILE_INDEX_1, localize_string_key_AlertDrink, 50);
}

#if defined(USE_CT1711)
#ifdef IT_POWER_01_UI
void view_prompt_hyperthemia_display(void)
{
    if (disp_ctrl.loop_cnt == 0)
    {
        disp_ctrl.auto_refresh_time = 1000;
        disp_ctrl.auto_close_delay = disp_ctrl.auto_refresh_time + 1000;
        datetime_t UIdatetime = DateSync();
        disp_ctrl.com_data.f_temp[0] = get_body_temperature();
        if (isnan(disp_ctrl.com_data.f_temp[0]))
        {
            display_show_type_recover();
            return;
        }
        disp_ctrl.com_data.i_temp[21] = weather_get_temperature_type();
        disp_ctrl.com_data.i_temp[3] = UIdatetime.time.hour;
        if (if_time_hour_system_12())
        {
            disp_ctrl.com_data.i_temp[3] %= 12;
            if (disp_ctrl.com_data.i_temp[3] == 0)
            {
                disp_ctrl.com_data.i_temp[3] = 12;
            }
        }
        disp_ctrl.com_data.i_temp[4] = UIdatetime.time.minute;
        disp_ctrl.com_data.i_temp[8] = battery_ctrl_if_charging();
        disp_ctrl.com_data.i_temp[9] = battery_ctrl_get_percent();
        disp_ctrl.com_data.i_temp[5] = ble_if_connected();
    }
    if (disp_ctrl.com_data.i_temp[5])
    {
        disp_draw_user_image(42, 3, img_ble_connect);
    }
    else
    {
        disp_draw_user_image(42, 0, img_ble_disconnect);
    }
    show_common_time(disp_ctrl.com_data.i_temp[3], disp_ctrl.com_data.i_temp[4]);
    show_time_0_battery(disp_ctrl.com_data.i_temp[9], disp_ctrl.com_data.i_temp[8]);
    float temperature = disp_ctrl.com_data.f_temp[0];
    uint16_t back_color = 0;
    int back_start_y = 0;
    int back_end_y = 0;
    int y = 0;
    if (temperature >= 32.f && temperature < 37.5f)
    {
        back_start_y = 0;
        back_end_y = 119;
        back_color = 0x1fc5;
        y = 40;
        if (disp_ctrl.loop_cnt == 0)
        {
            if (disp_ctrl.auto_refresh_count >= 5)
            {
                if (disp_ctrl.disp_type_back != view_temperature_icon)
                {
                    display_show(view_close_oled, DISP_MODE_NORMAL);
                }
                else
                {
                    display_show_type_recover();
                }
            }
        }
    }
    else if (temperature >= 37.5f && temperature < 38.5f)
    {
        back_start_y = 120;
        back_end_y = 239;
        back_color = 0xfa23;
        y = 167;
        if (disp_ctrl.loop_cnt == 0)
        {
            if (disp_ctrl.auto_refresh_count < 3)
            {
                motor_start(100);
            }
            if (disp_ctrl.auto_refresh_count >= 10)
            {
                if (disp_ctrl.disp_type_back != view_temperature_icon)
                {
                    display_show(view_close_oled, DISP_MODE_NORMAL);
                }
                else
                {
                    display_show_type_recover();
                }
            }
        }
    }
    else if (temperature >= 38.5f && temperature < 43.f)
    {
        back_start_y = 0;
        back_end_y = 239;
        back_color = RGB565_COLOR_RED;
        y = 100;
        if (disp_ctrl.loop_cnt == 0)
        {
            if (disp_ctrl.auto_refresh_count < 5)
            {
                motor_start(100);
            }
            if (disp_ctrl.auto_refresh_count >= 30)
            {
                if (disp_ctrl.disp_type_back != view_temperature_icon)
                {
                    display_show(view_close_oled, DISP_MODE_NORMAL);
                }
                else
                {
                    display_show_type_recover();
                }
            }
        }
    }
    else
    {
        return;
    }
    disp_draw_rect_color(0, back_start_y, 239, back_end_y, back_color);
    bool is_centigrade = disp_ctrl.com_data.i_temp[21] == WEATHER_TEMPERATURE_TYPE_C;
    if (!is_centigrade)
    {
        temperature = 32.f + temperature * 1.8f;
    }
    int temperature_int = temperature * 100;

    int const font_width = 18;
    int const font_height = 41;
    int const font_interval = 3;
    int const point_front_interval = 4;
    int const point_width = 6;
    int const point_height = 6;
    int const point_back_interval = 7;
    int const uinit_interval = 5;
    int const unit_widht = 23;
    int num_digits = get_num_digit(temperature_int / 10);
    int const total_width = font_width * num_digits + (num_digits - 2) * font_interval + point_front_interval + point_width + point_back_interval + uinit_interval + unit_widht;
    int draw_x = (239 - total_width) / 2;
    if (disp_ctrl.loop_cnt == 0)
    {
        LOG("draw_x %d", draw_x);
    }
    // num_18x41_black_TAB
    // 32 - 37.4 normal
    // 37.5 -38.4 yellow
    // red 38.5-42.9

    if (temperature < 0)
    {
        disp_draw_rect_color(draw_x, y + font_height / 2 - 1, draw_x + font_width - 1, y + font_height / 2, RGB565_COLOR_WHITE);
        draw_x += font_width + font_interval;
    }
    draw_x = disp_draw_user_image_num_multiply(draw_x, y, temperature_int / 100, font_width + font_interval, num_18x41_black_TAB);
    draw_x -= font_interval;
    draw_x += point_front_interval;
    disp_draw_rect_color(draw_x, y + font_height - point_height, draw_x + point_width - 1, y + font_height - 1, RGB565_COLOR_BLACK);
    draw_x += point_width + point_back_interval;
    draw_x = disp_draw_user_image_num_with_digits_multiply(draw_x, y, temperature_int % 100, 2, font_width + font_interval, num_18x41_black_TAB);
    draw_x -= font_interval;
    draw_x += uinit_interval;

    if (is_centigrade)
    {
        disp_draw_user_image_multiply(draw_x, y, num_18x41_celsius);
    }
    else
    {
        disp_draw_user_image_multiply(draw_x, y, num_18x41_fahrenheit);
    }
    if (disp_ctrl.loop_cnt == 0)
    {
        LOG("draw_x end %d", draw_x);
    }
}
#else
void view_prompt_hyperthemia_display(void)
{
    if (disp_ctrl.loop_cnt == 0)
    {
        if (disp_ctrl.auto_refresh_count == 0)
        {
            motor_start(200);
        }
        disp_ctrl.auto_refresh_time = 1000;
        disp_ctrl.auto_close_delay = disp_ctrl.auto_refresh_time + 1000;
        if (disp_ctrl.auto_refresh_count >= 5)
        {
            display_show_type_recover();
        }
        datetime_t UIdatetime = DateSync();
        disp_ctrl.com_data.i_temp[3] = UIdatetime.time.hour;
        if (if_time_hour_system_12())
        {
            disp_ctrl.com_data.i_temp[3] %= 12;
            if (disp_ctrl.com_data.i_temp[3] == 0)
            {
                disp_ctrl.com_data.i_temp[3] = 12;
            }
        }
        disp_ctrl.com_data.i_temp[4] = UIdatetime.time.minute;
        disp_ctrl.com_data.i_temp[8] = battery_ctrl_if_charging();
        disp_ctrl.com_data.i_temp[9] = battery_ctrl_get_percent();
        disp_ctrl.com_data.i_temp[5] = ble_if_connected();
    }
    if (disp_ctrl.com_data.i_temp[5])
    {
        disp_draw_user_image(42, 3, img_ble_connect);
    }
    else
    {
        disp_draw_user_image(42, 0, img_ble_disconnect);
    }
    show_common_time(disp_ctrl.com_data.i_temp[3], disp_ctrl.com_data.i_temp[4]);
    show_time_0_battery(disp_ctrl.com_data.i_temp[9], disp_ctrl.com_data.i_temp[8]);
    _disp_show_flash_img(DISP_LFS_FILE_INDEX_0, 56, 31, FILE_IMG_t509_tem_heigh_icon_56_31);
    disp_show_localize(DISP_LFS_FILE_INDEX_1, localize_string_key_Hyperthemia, 50);
}
#endif
void view_prompt_body_temperature_fail_display(void)
{
    if (disp_ctrl.loop_cnt == 0)
    {
        if (disp_ctrl.auto_refresh_count == 0)
        {
            motor_start(200);
        }
        disp_ctrl.auto_refresh_time = 1000;
        disp_ctrl.auto_close_delay = disp_ctrl.auto_refresh_time + 1000;
        if (disp_ctrl.auto_refresh_count >= 5)
        {
            display_show_type_recover();
        }
        datetime_t UIdatetime = DateSync();
        disp_ctrl.com_data.i_temp[3] = UIdatetime.time.hour;
        if (if_time_hour_system_12())
        {
            disp_ctrl.com_data.i_temp[3] %= 12;
            if (disp_ctrl.com_data.i_temp[3] == 0)
            {
                disp_ctrl.com_data.i_temp[3] = 12;
            }
        }
        disp_ctrl.com_data.i_temp[4] = UIdatetime.time.minute;
        disp_ctrl.com_data.i_temp[8] = battery_ctrl_if_charging();
        disp_ctrl.com_data.i_temp[9] = battery_ctrl_get_percent();
        disp_ctrl.com_data.i_temp[5] = ble_if_connected();
    }
    if (disp_ctrl.com_data.i_temp[5])
    {
        disp_draw_user_image(42, 3, img_ble_connect);
    }
    else
    {
        disp_draw_user_image(42, 0, img_ble_disconnect);
    }
    show_common_time(disp_ctrl.com_data.i_temp[3], disp_ctrl.com_data.i_temp[4]);
    show_time_0_battery(disp_ctrl.com_data.i_temp[9], disp_ctrl.com_data.i_temp[8]);

    _disp_show_flash_img(DISP_LFS_FILE_INDEX_0, 56, 31, FILE_IMG_t509_tem_fail_tips_56_31);
    disp_show_localize(DISP_LFS_FILE_INDEX_1, localize_string_key_MeasuringBodyTemperatureFailTips, 50);
}
#endif

void view_prompt_sedentariness_display(void)
{
    if (disp_ctrl.loop_cnt == 0)
    {
        disp_ctrl.auto_refresh_time = 1000;
        disp_ctrl.auto_close_delay = disp_ctrl.auto_refresh_time + 1000;
        if (disp_ctrl.auto_refresh_count >= 5)
        {
            display_show_type_recover();
        }
        datetime_t UIdatetime = DateSync();
        disp_ctrl.com_data.i_temp[3] = UIdatetime.time.hour;
        if (if_time_hour_system_12())
        {
            disp_ctrl.com_data.i_temp[3] %= 12;
            if (disp_ctrl.com_data.i_temp[3] == 0)
            {
                disp_ctrl.com_data.i_temp[3] = 12;
            }
        }
        disp_ctrl.com_data.i_temp[4] = UIdatetime.time.minute;
        disp_ctrl.com_data.i_temp[8] = battery_ctrl_if_charging();
        disp_ctrl.com_data.i_temp[9] = battery_ctrl_get_percent();
        disp_ctrl.com_data.i_temp[5] = ble_if_connected();
    }
    if (disp_ctrl.com_data.i_temp[5])
    {
        disp_draw_user_image(42, 3, img_ble_connect);
    }
    else
    {
        disp_draw_user_image(42, 0, img_ble_disconnect);
    }
    show_common_time(disp_ctrl.com_data.i_temp[3], disp_ctrl.com_data.i_temp[4]);
    show_time_0_battery(disp_ctrl.com_data.i_temp[9], disp_ctrl.com_data.i_temp[8]);
#if defined(Z2_BOARD) || defined(BT100_BOARD)
    _disp_show_flash_img(DISP_LFS_FILE_INDEX_0, 57, 31, FILE_IMG_1302_sed_57_31);
#else
    _disp_show_flash_img(DISP_LFS_FILE_INDEX_0, 82, 44, FILE_IMG_J107_sedentaryreminder_82_44);
#endif
    // _disp_show_flash_img(DISP_LFS_FILE_INDEX_1, 20, 177, FILE_IMG_J108_sedentaryreminder_text_20_177);
    // disp_show_localize(DISP_LFS_FILE_INDEX_1, localize_string_key_AlertSedentary, FILE_IMG_localize_en_AlertSedentary_20_177, 20, 177, 50);
    disp_show_localize(DISP_LFS_FILE_INDEX_1, localize_string_key_AlertSedentary, 50);
}
void view_prompt_low_power_display(void)
{
    if (disp_ctrl.loop_cnt == 0)
    {
        disp_ctrl.auto_refresh_time = 1000;
        disp_ctrl.auto_close_delay = disp_ctrl.auto_refresh_time + 1000;
        if (disp_ctrl.auto_refresh_count >= 5)
        {
            display_show_type_recover();
        }
        datetime_t UIdatetime = DateSync();
        disp_ctrl.com_data.i_temp[3] = UIdatetime.time.hour;
        if (if_time_hour_system_12())
        {
            disp_ctrl.com_data.i_temp[3] %= 12;
            if (disp_ctrl.com_data.i_temp[3] == 0)
            {
                disp_ctrl.com_data.i_temp[3] = 12;
            }
        }
        disp_ctrl.com_data.i_temp[4] = UIdatetime.time.minute;
        disp_ctrl.com_data.i_temp[8] = battery_ctrl_if_charging();
        disp_ctrl.com_data.i_temp[9] = battery_ctrl_get_percent();
        disp_ctrl.com_data.i_temp[5] = ble_if_connected();
    }
    if (disp_ctrl.com_data.i_temp[5])
    {
        disp_draw_user_image(42, 3, img_ble_connect);
    }
    else
    {
        disp_draw_user_image(42, 0, img_ble_disconnect);
    }
    show_common_time(disp_ctrl.com_data.i_temp[3], disp_ctrl.com_data.i_temp[4]);
    show_time_0_battery(disp_ctrl.com_data.i_temp[9], disp_ctrl.com_data.i_temp[8]);
#if defined(Z2_BOARD) || defined(BT100_BOARD)
    _disp_show_flash_img(DISP_LFS_FILE_INDEX_0, 57, 31, FILE_IMG_1305_batter_57_31);
#else
    _disp_show_flash_img(DISP_LFS_FILE_INDEX_0, 40, 72, FILE_IMG_J113_lowbatter_40_72);
#endif

    // _disp_show_flash_img(DISP_LFS_FILE_INDEX_1, 61, 183, FILE_IMG_J114_lowbatter_text_61_183);
    // disp_show_localize(DISP_LFS_FILE_INDEX_1, localize_string_key_AlertLowBattery, FILE_IMG_localize_en_AlertLowBattery_61_183, 61, 183, 50);
    disp_show_localize(DISP_LFS_FILE_INDEX_1, localize_string_key_AlertLowBattery, 50);
}
void view_prompt_not_wear_display(void)
{
    if (disp_ctrl.loop_cnt == 0)
    {
        disp_ctrl.auto_refresh_time = 1000;
        disp_ctrl.auto_close_delay = disp_ctrl.auto_refresh_time + 1000;
        if (disp_ctrl.auto_refresh_count >= 5)
        {
            display_show_type_recover();
        }
        datetime_t UIdatetime = DateSync();
        disp_ctrl.com_data.i_temp[3] = UIdatetime.time.hour;
        if (if_time_hour_system_12())
        {
            disp_ctrl.com_data.i_temp[3] %= 12;
            if (disp_ctrl.com_data.i_temp[3] == 0)
            {
                disp_ctrl.com_data.i_temp[3] = 12;
            }
        }
        disp_ctrl.com_data.i_temp[4] = UIdatetime.time.minute;
        disp_ctrl.com_data.i_temp[8] = battery_ctrl_if_charging();
        disp_ctrl.com_data.i_temp[9] = battery_ctrl_get_percent();
        disp_ctrl.com_data.i_temp[5] = ble_if_connected();
    }
    if (disp_ctrl.com_data.i_temp[5])
    {
        disp_draw_user_image(42, 3, img_ble_connect);
    }
    else
    {
        disp_draw_user_image(42, 0, img_ble_disconnect);
    }
    show_common_time(disp_ctrl.com_data.i_temp[3], disp_ctrl.com_data.i_temp[4]);
    show_time_0_battery(disp_ctrl.com_data.i_temp[9], disp_ctrl.com_data.i_temp[8]);

    _disp_show_flash_img(DISP_LFS_FILE_INDEX_0, 25, 73, FILE_IMG_J115_notwearingawatch_25_73);
    //_disp_show_flash_img(DISP_LFS_FILE_INDEX_1, 18, 183, FILE_IMG_J115_notwearingawatch_text_18_183);
    // disp_show_localize(DISP_LFS_FILE_INDEX_1, localize_string_key_AlertNotWear, FILE_IMG_localize_en_AlertNotWear_18_183, 18, 183, 50);
    disp_show_localize(DISP_LFS_FILE_INDEX_1, localize_string_key_AlertNotWear, 50);
}
void view_prompt_finding_display(void)
{
    if (disp_ctrl.loop_cnt == 0)
    {
        disp_ctrl.auto_refresh_time = 1000;
        disp_ctrl.auto_close_delay = disp_ctrl.auto_refresh_time + 1000;
        if (disp_ctrl.auto_refresh_count >= 10)
        {
            display_show_type_recover();
            return;
        }
        datetime_t UIdatetime = DateSync();
        disp_ctrl.com_data.i_temp[3] = UIdatetime.time.hour;
        if (if_time_hour_system_12())
        {
            disp_ctrl.com_data.i_temp[3] %= 12;
            if (disp_ctrl.com_data.i_temp[3] == 0)
            {
                disp_ctrl.com_data.i_temp[3] = 12;
            }
        }
        disp_ctrl.com_data.i_temp[4] = UIdatetime.time.minute;
        disp_ctrl.com_data.i_temp[8] = battery_ctrl_if_charging();
        disp_ctrl.com_data.i_temp[9] = battery_ctrl_get_percent();
        disp_ctrl.com_data.i_temp[5] = ble_if_connected();
    }
    if (disp_ctrl.com_data.i_temp[5])
    {
        disp_draw_user_image(42, 3, img_ble_connect);
    }
    else
    {
        disp_draw_user_image(42, 0, img_ble_disconnect);
    }
    show_common_time(disp_ctrl.com_data.i_temp[3], disp_ctrl.com_data.i_temp[4]);
    show_time_0_battery(disp_ctrl.com_data.i_temp[9], disp_ctrl.com_data.i_temp[8]);

    _disp_show_flash_img(DISP_LFS_FILE_INDEX_0, 69, 21, FILE_IMG_J211_lookforband_69_21);
}
void view_prompt_charing_display(void)
{
    if (disp_ctrl.loop_cnt == 0)
    {
        datetime_t UIdatetime = DateSync();
        disp_ctrl.com_data.i_temp[3] = UIdatetime.time.hour;
        if (if_time_hour_system_12())
        {
            disp_ctrl.com_data.i_temp[3] %= 12;
            if (disp_ctrl.com_data.i_temp[3] == 0)
            {
                disp_ctrl.com_data.i_temp[3] = 12;
            }
        }
        disp_ctrl.com_data.i_temp[4] = UIdatetime.time.minute;
        disp_ctrl.com_data.i_temp[8] = battery_ctrl_if_charging();
        disp_ctrl.com_data.i_temp[9] = battery_ctrl_get_percent();
        disp_ctrl.com_data.i_temp[5] = ble_if_connected();
        product_test_state_t state = product_test_state_get();
        switch (state)
        {
        case PRODUCT_TEST_STATE_TEST_PCBA:
            disp_ctrl.auto_refresh_time = 300;
            disp_ctrl.auto_close_delay = 2000;
            break;
        case PRODUCT_TEST_STATE_TEST_ASSEM:
            disp_ctrl.auto_refresh_time = 300;
            break;
        }
    }
    if (disp_ctrl.com_data.i_temp[5])
    {
        disp_draw_user_image(42, 3, img_ble_connect);
    }
    else
    {
        disp_draw_user_image(42, 0, img_ble_disconnect);
    }
    show_common_time(disp_ctrl.com_data.i_temp[3], disp_ctrl.com_data.i_temp[4]);
    show_time_0_battery(disp_ctrl.com_data.i_temp[9], disp_ctrl.com_data.i_temp[8]);
    img_gif_com_t const img_cfg_2 = {
        .gif_count = 4,
        .img[0].x = 74,
        .img[0].y = 57,
        .img[0].sn = FILE_IMG_J212_charging_74_57,
        .img[1].x = 74,
        .img[1].y = 57,
        .img[1].sn = FILE_IMG_J213_charging_74_57,
        .img[2].x = 74,
        .img[2].y = 57,
        .img[2].sn = FILE_IMG_J214_charging_74_57,
        .img[3].x = 74,
        .img[3].y = 57,
        .img[3].sn = FILE_IMG_J215_charging_74_57,
    };
    _disp_show_flash_img_gif_all(&img_cfg_2, DISP_LFS_FILE_INDEX_1);
}
void view_prompt_alarm_display(void)
{
    if (disp_ctrl.loop_cnt == 0)
    {
        disp_ctrl.auto_refresh_time = 500;
        disp_ctrl.auto_close_delay = disp_ctrl.auto_refresh_time + 1000;
        if (disp_ctrl.auto_refresh_count >= 30 * 2)
        {
            display_show_type_recover();
        }
        disp_ctrl.com_data.i_temp[2] = get_present_day_minute();
        disp_ctrl.com_data.i_temp[0] = disp_ctrl.com_data.i_temp[2] / 60;
        disp_ctrl.com_data.i_temp[1] = disp_ctrl.com_data.i_temp[2] % 60;
        datetime_t UIdatetime = DateSync();
        disp_ctrl.com_data.i_temp[3] = UIdatetime.time.hour;
        if (if_time_hour_system_12())
        {
            disp_ctrl.com_data.i_temp[3] %= 12;
            if (disp_ctrl.com_data.i_temp[3] == 0)
            {
                disp_ctrl.com_data.i_temp[3] = 12;
            }
        }
        disp_ctrl.com_data.i_temp[4] = UIdatetime.time.minute;
        disp_ctrl.com_data.i_temp[8] = battery_ctrl_if_charging();
        disp_ctrl.com_data.i_temp[9] = battery_ctrl_get_percent();
        disp_ctrl.com_data.i_temp[5] = ble_if_connected();
    }
    if (disp_ctrl.com_data.i_temp[5])
    {
        disp_draw_user_image(42, 3, img_ble_connect);
    }
    else
    {
        disp_draw_user_image(42, 0, img_ble_disconnect);
    }
    show_time_0_battery(disp_ctrl.com_data.i_temp[9], disp_ctrl.com_data.i_temp[8]);
#if defined(Z2_BOARD) || defined(BT100_BOARD)
    _disp_show_flash_img(DISP_LFS_FILE_INDEX_0, 57, 31, FILE_IMG_1304_alarm_57_31);
#else
    _disp_show_flash_img(DISP_LFS_FILE_INDEX_0, 68, 54, FILE_IMG_J111_alarmclock_68_54);
#endif

    int x = 70;
    int y = 181;
    x = disp_draw_user_image_num_with_digits(x, y, disp_ctrl.com_data.i_temp[3], 2, 23, img_j501_TAB);
    disp_draw_user_image(x, y, img_j501_two_point);
    x += 14;
    disp_draw_user_image_num_with_digits(x, y, disp_ctrl.com_data.i_temp[4], 2, 23, img_j501_TAB);
}
bool view_prompt_display(int view)
{
    switch (view)
    {
    case view_prompt_message:
        view_prompt_message_display();
        return true;
    case view_prompt_not_connect:
        view_prompt_not_connect_display();
        return true;
    case view_prompt_distance_complete:
        view_prompt_distance_complete_display();
        return true;
    case view_prompt_calories_complete:
        view_prompt_calories_complete_display();
        return true;
    case view_prompt_steps_complete:
        view_prompt_steps_complete_display();
        return true;
    case view_prompt_lost:
        view_prompt_lost_display();
        return true;
    case view_prompt_drink:
        view_prompt_drink_display();
        return true;
    case view_prompt_alarm:
        view_prompt_alarm_display();
        return true;
    case view_prompt_sedentariness:
        view_prompt_sedentariness_display();
        return true;
    case view_prompt_low_power:
        view_prompt_low_power_display();
        return true;
    case view_prompt_charing:
        view_prompt_charing_display();
        return true;
    case view_prompt_finding:
        view_prompt_finding_display();
        return true;
    case view_prompt_not_wear:
        view_prompt_not_wear_display();
        return true;
    case view_prompt_bind_success:
        view_prompt_bind_success_display();
        return true;
    case view_prompt_camera_ready:
        view_prompt_camera_ready_display();
        return true;
    case view_prompt_camera_fail:
        view_prompt_camera_fail_display();
        return true;
#if defined(USE_CT1711)
    case view_prompt_hyperthemia:
        view_prompt_hyperthemia_display();
        return true;
    case view_prompt_body_temperature_fail:
        view_prompt_body_temperature_fail_display();
        return true;
#endif
    }
    return false;
}
bool view_power_off_charing_event(event_param_t param)
{
    if (!battery_ctrl_if_charging())
    {
        return false;
    }
    switch (param.event)
    {
    case BUTTON_EVENT_SHORT_PRESS:
        if (disp_ctrl.auto_close_delay < DISP_CLOSE_TIME_DEFAULT)
        {
            disp_ctrl.auto_close_delay = DISP_CLOSE_TIME_DEFAULT;
        }
        display_show(view_prompt_charing, DISP_MODE_NORMAL);
        break;
    }
    return false;
}
bool view_prompt_alarm_event(int32_t view, event_param_t param)
{
    switch (param.event)
    {
    case event_view_exit:
        motor_stop();
        return true;
    }
    return false;
}
bool view_prompt_event(int view, event_param_t param)
{
    if (view < view_prompt_start || view >= view_prompt_end)
    {
        return false;
    }
    bool result = false;
    switch (view)
    {
    case view_prompt_message:
        result = view_prompt_message_event(view, param);
        break;
    case view_prompt_alarm:
        result = view_prompt_alarm_event(view, param);
        break;
    case view_prompt_distance_complete:
        result = view_prompt_distance_complete_event(view, param);
        break;
    case view_prompt_calories_complete:
        result = view_prompt_calories_complete_event(view, param);
        break;
    case view_prompt_steps_complete:
        result = view_prompt_steps_complete_event(view, param);
        break;
    case view_prompt_finding:
        result = view_prompt_find_wrist_event(view, param);
        break;
#if defined(USE_CT1711)
    case view_prompt_hyperthemia:
        result = view_prompt_hyperthemia_event(view, param);
        break;
#endif
    }
    if (result)
    {
        return true;
    }
    switch (param.event)
    {
#ifdef EVENT_BUTTON_FRONT
    case event_button_front_long_press:
#endif
#ifdef USE_TOUCHPAD
    case BUTTON_EVENT_TP_TAP_LONG:
#endif
#ifdef EVENT_LEVEL_UP
    case event_move_level_up:
#endif
        display_show_type_recover();
        return true;
    }
    return false;
}
